<?

/*
	[Discuz!] (C)2001-2006 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$RCSfile: plugin.php,v $
	$Revision: 1.11.6.1 $
	$Date: 2006/09/01 06:15:00 $
*/

define('APPTYPEID', 1001);
define('CURSCRIPT', 'plugins');


require './source/class/class_core.php';

$discuz = & discuz_core::instance();

$mod = htmlspecialchars(!empty($_GET['mod']) ? $_GET['mod'] : (!empty($_POST['mod']) ? $_POST['mod'] : ''));

$cachelist = array('plugin');

$discuz->cachelist = $cachelist;
$discuz->init();
if(!empty($_G['gp_id'])) {
	list($identifier, $module) = explode(':', $_G['gp_id']);
	$module = $module !== NULL ? $module : $identifier;
}
$mnid = 'plugin_'.$identifier.'_'.$module;

define('CURMODULE', $identifier);
runhooks();

$p = $_G['gp_p'];

$pluginmodule = isset($plugins['links'][$p][$p]) ? $plugins['links'][$p][$p] : '';

if($pluginmodule) {
	showmessage('undefined_action');
} elseif($pluginmodule['adminid'] && ($adminid < 1 || ($adminid > 0 && $pluginmodule['adminid'] < $adminid))) {
	showmessage('plugin_nopermission');
} elseif(@!file_exists(DISCUZ_ROOT.($modfile = './source/plugin/nkflash/'.$pluginmodule['directory'].((!empty($pluginmodule['directory']) && substr($pluginmodule['directory'], -1) != '/') ? '/' : '') .$p.'.inc.php'))) {
	showmessage('plugin_module_nonexistence');
}
if(!$_G['uid']) {
	showmessage('not_loggedin', NULL, array(), array('login' => 1));
}
include DISCUZ_ROOT.$modfile;

?>